


use "~/04_de_soysa_neumayer_2005/replication_data.dta", clear
* Change path as needed

* Declare panel data
xtset counter year

* Table 2: The effect of trade dependence on genuine savings
* Random effects GLS

* Original: De Soysa and Neumayer's table 1, model 1
xi: xtregar gsrgnicorrected Llntrd Llngni Llngni2 Lgrowth Laggdp Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden Llnpop Llnurban Lbigwar peaceyrs i.year , 
eststo model1, title("Original Model")

* Using 2002 data
xi: xtregar gsrgnicorrected_2002 Llntrd_2002 Llngni_2002 Llngni2_2002 Lgrowth_2002 Laggdp_2002 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2002 Llnpop_2002 Llnurban_2002 Lbigwar peaceyrs i.year , 
eststo model2, title("WDI 2002")

* Using 2012 data
xi: xtregar gsrgnicorrected_2012 Llntrd_2012 Llngni_2012 Llngni2_2012 Lgrowth_2012 Laggdp_2012 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2012 Llnpop_2012 Llnurban_2012 Lbigwar peaceyrs i.year , 
eststo model3, title("WDI 2012")

* Using 2022 data
xi: xtregar gsrgnicorrected_2022 Llntrd_2022 Llngni_2022 Llngni2_2022 Lgrowth_2022 Laggdp_2022 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2022 Llnpop_2022 Llnurban_2022 Lbigwar peaceyrs i.year , 
eststo model4, title("WDI 2022")

* Export
esttab model1 model2 model3 model4 using results.tex, mtitle star(* 0.1 ** 0.05 *** 0.01) b(3) se drop (_Iyear*) stats(N N_g, labels("Observations" "Countries")) nogaps replace





******** APPENDIX ********

use "~/04_de_soysa_neumayer_2005/replication_data_complete_observations.dta", clear
* Change path as needed

* Declare panel data
xtset counter year

* Table A.1: The effect of trade dependence on genuine savings
* Random effects GLS
* Reducing all vintages to the common denominator

* Original: De Soysa and Neumayer's table 1, model 1
xi: xtregar gsrgnicorrected Llntrd Llngni Llngni2 Lgrowth Laggdp Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden Llnpop Llnurban Lbigwar peaceyrs i.year , 
eststo model5, title("Original Model")

* Using 2002 data
xi: xtregar gsrgnicorrected_2002 Llntrd_2002 Llngni_2002 Llngni2_2002 Lgrowth_2002 Laggdp_2002 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2002 Llnpop_2002 Llnurban_2002 Lbigwar peaceyrs i.year , 
eststo model6, title("WDI 2002")

* Using 2012 data
xi: xtregar gsrgnicorrected_2012 Llntrd_2012 Llngni_2012 Llngni2_2012 Lgrowth_2012 Laggdp_2012 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2012 Llnpop_2012 Llnurban_2012 Lbigwar peaceyrs i.year , 
eststo model7, title("WDI 2012")

* Using 2022 data
xi: xtregar gsrgnicorrected_2022 Llntrd_2022 Llngni_2022 Llngni2_2022 Lgrowth_2022 Laggdp_2022 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2022 Llnpop_2022 Llnurban_2022 Lbigwar peaceyrs i.year , 
eststo model8, title("WDI 2022")

* Export
esttab model5 model6 model7 model8 using results.tex, mtitle star(* 0.1 ** 0.05 *** 0.01) b(3) se drop (_Iyear*) stats(N N_g, labels("Observations" "Countries")) nogaps replace



use "~/04_de_soysa_neumayer_2005/replication_data.dta", clear
* Change path as needed

* Declare panel data
xtset counter year

* Table A.2: The effect of FDI dependence on genuine savings
* Random effects GLS

* Original: De Soysa and Neumayer's table 1, model 2
xi: xtregar gsrgnicorrected Llnfdikgdp  Llngni  Llngni2 Lgrowth Laggdp Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden Llnpop Llnurban Lbigwar peaceyrs i.year , 
eststo model9, title("Original Model")

* Using 2002 data
xi: xtregar gsrgnicorrected_2002 Llnfdikgdp Llngni_2002 Llngni2_2002 Lgrowth_2002 Laggdp_2002 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2002 Llnpop_2002 Llnurban_2002 Lbigwar peaceyrs i.year , 
eststo model10, title("WDI 2002")

* Using 2012 data
xi: xtregar gsrgnicorrected_2012 Llnfdikgdp Llngni_2012 Llngni2_2012 Lgrowth_2012 Laggdp_2012 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2012 Llnpop_2012 Llnurban_2012 Lbigwar peaceyrs i.year , 
eststo model11, title("WDI 2012")

* Using 2022 data
xi: xtregar gsrgnicorrected_2022 Llnfdikgdp Llngni_2022 Llngni2_2022 Lgrowth_2022 Laggdp_2022 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2022 Llnpop_2022 Llnurban_2022 Lbigwar peaceyrs i.year , 
eststo model12, title("WDI 2022")

* Export
esttab model9 model10 model11 model12 using results.tex, mtitle star(* 0.1 ** 0.05 *** 0.01) b(3) se drop (_Iyear*) stats(N N_g, labels("Observations" "Countries")) nogaps replace



* Table A.3: The effect of trade and FDI dependence on genuine savings
* Random effects GLS

* Original: De Soysa and Neumayer's table 1, model 3
xi: xtregar gsrgnicorrected Llntrd Llnfdikgdp Llngni Llngni2 Lgrowth Laggdp Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden Llnpop Llnurban Lbigwar peaceyrs i.year , 
eststo model13, title("Original Model")

* Using 2002 data
xi: xtregar gsrgnicorrected_2002 Llntrd_2002 Llnfdikgdp Llngni_2002 Llngni2_2002 Lgrowth_2002 Laggdp_2002 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2002 Llnpop_2002 Llnurban_2002 Lbigwar peaceyrs i.year , 
eststo model14, title("WDI 2002")

* Using 2012 data
xi: xtregar gsrgnicorrected_2012 Llntrd_2012 Llnfdikgdp Llngni_2012 Llngni2_2012 Lgrowth_2012 Laggdp_2012 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2012 Llnpop_2012 Llnurban_2012 Lbigwar peaceyrs i.year , 
eststo model15, title("WDI 2012")

* Using 2022 data
xi: xtregar gsrgnicorrected_2022 Llntrd_2022 Llnfdikgdp Llngni_2022 Llngni2_2022 Lgrowth_2022 Laggdp_2022 Lcurrencycrisis expoil Ldemoc2 Lpolcon3 Lstabs Llnden_2022 Llnpop_2022 Llnurban_2022 Lbigwar peaceyrs i.year , 
eststo model16, title("WDI 2022")

* Export
esttab model13 model14 model15 model16 using results.tex, mtitle star(* 0.1 ** 0.05 *** 0.01) b(3) se drop (_Iyear*) stats(N N_g, labels("Observations" "Countries")) nogaps replace






